﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Security;

namespace Pixysoft.Framework.Security.Tokens
{
    [Serializable]
    public class TokenUserInfo
    {
        string name;
        string md5password;
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        public string Md5Password
        {
            get { return md5password; }
            set { md5password = value; }
        }

        /// <summary>
        /// 键值的键，是name + pwd的md5
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return string.Format("{0}{1}", name, md5password);
        }

        private TokenUserInfo()
        {
        }

        public TokenUserInfo(string name, string orgpassword)
        {
            this.name = name;

            this.md5password = MD5.GetMD5(orgpassword);
        }
    }
}
